import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: "/firstPage",
  },
  //首页
  {
    path: '/home',
    name: 'Home',
    component: () => import('../views/Home/index.vue'),
    children: [
      //首页
      {
        path: '/firstPage',
        name: 'FirstPage',
        component: () => import('../views/firstpage/index'),
        children: [
          // 热映
          {
            path: '/hotmovie',
            name: 'Hotmovie',
            component: () => import('../views/hotmovie/index')
          },
          // 影院
          {
            path: '/cinema',
            name: 'Cinema',
            component: () => import('../views/cinema/index')
          },
          // 待映
          {
            path: '/shown',
            name: 'Shown',
            component: () => import('../views/shown/index')
          },
          // 经典电影
          {
            path: '/classic',
            name: 'Classic',
            component: () => import('../views/classic/index')
          }
        ]
      },
      //  //视频
      //  {
      //   path: '/viedo',
      //   name: 'FirstPage',
      //   component: () => import('../views/viedo/index')
      // },
      //  //小视频
      //  {
      //   path: '/home/smlVideo',
      //   name: 'FirstPage',
      //   component: () => import('../views/firstpage/index')
      // },

    ]
  },
  // //演出
  // {
  //   path: '/show',
  //   name: 'Show',
  //   component: () => import('../views/show/index')
  // },
  //我的
  //  {
  //   path: '/My',
  //   name: 'Login',
  //   component: () => import('../views/login/index')
  // },
  //登录
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/login/index')
  },
  {
    path: '*',
    name: '404',
    component: () => import('../views/404/index'),
    hidden: true
  },
]



const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
